package cn.iocoder.yudao.adminserver.franky.LRU;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @Description: 饿汉式
 * @Author: franky
 * @CreateDate: 2021/4/19 1:23 下午
 * @Version: 1.0
 */
public class Singleton1 {
    public static final Singleton1 instance = new Singleton1();
    AtomicLong atomicLong = new AtomicLong(0);
    private Singleton1(){}

    public static Singleton1 getInstance() {
        return instance;
    }

    public long getId() {
        return atomicLong.incrementAndGet();
    }
}
